﻿#include <iostream>
#include <vector>
using namespace std;

class Solution
{
public:
    // 300. 最长递增子序列
    int lengthOfLIS(vector<int>& nums)
    {
        int n = nums.size();
        vector<int> dp(n, 1);

        int ret = 1;
        for (int i = 1; i < n; i++)
        {
            for (int j = 0; j < i; j++)
            {
                if (nums[j] < nums[i])
                {
                    dp[i] = max(dp[j] + 1, dp[i]);
                }
            }
            ret = max(ret, dp[i]);
        }
        return ret;
    }
};

int main()
{
    vector<int> v = { 0,1,2,0,3,4,0,5 };
    Solution().lengthOfLIS(v);

    return 0;
}